Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
babel-plugin-apply-mdx-type-prop
Advanced tools
babel-plugin-apply-mdx-type-prop
Babel plugin that applies the mdxType
prop which is
used by the MDX pragma.
It also stores all components encountered as names
in
the plugin state.
yarn add babel-plugin-apply-mdx-type-prop
const babel = require('@babel/core')
const BabelPluginApplyMdxTypeProp = require('babel-plugin-apply-mdx-type-prop')
const jsx = `
export const Foo = () => (
<div>
<Button />
</div>
)
export default () => (
<>
<h1>Hello!</h1>
<TomatoBox />
</>
)
`
const plugin = new BabelPluginApplyMdxTypeProp()
const result = babel.transform(jsx, {
configFile: false,
plugins: ['@babel/plugin-syntax-jsx', plugin.plugin]
})
console.log(result.code)
console.log(plugin.state.names)
export const Foo = () => (
<div>
<Button />
</div>
)
export default () => (
<>
<h1>Hello!</h1>
<TomatoBox />
</>
)
export const Foo = () => (
<div>
<Button mdxType="Button" />
</div>
)
export default () => (
<>
<h1>Hello!</h1>
<TomatoBox mdxType="Button" />
</>
)
MIT
FAQs
Deprecated: this package is no longer maintained.
The npm package babel-plugin-apply-mdx-type-prop receives a total of 1,292,159 weekly downloads. As such, babel-plugin-apply-mdx-type-prop popularity was classified as popular.
We found that babel-plugin-apply-mdx-type-prop demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.